import React from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'

import INavLink from '../../components/INavLink'

import News from './News'
import Message from './Message'

function Home() {
  return (
    <div>
      <h3>Home的内容</h3>
      <div>
        <ul className='nav nav-tabs'>
          <li>
            <INavLink to='/home/news'>News</INavLink>
          </li>
          <li>
            <INavLink to='/home/message'>Message</INavLink>
          </li>
        </ul>
        {/* 注册子路由 */}
        <Switch>
          <Route path='/home/news' component={News} />
          <Route path='/home/message' component={Message} />
          <Redirect to='/home/news' />
        </Switch>
      </div>
    </div>
  )
}

export default Home
